#!/usr/bin/python

import sys
from math import sqrt
from sflib.py_finder import *

def main():
    for line in sys.stdin:
        id, seq = line.split()
        mx = create_mx(seq)
        #print_mx(mx)
        #print_mx(normalize_mx(mx))
        I = 2*sqrt(inf_mx(mx)) - sqrt(2*6-1)
        sys.stdout.write("%s\t%s\t%f\n" % (id, seq, I))

if __name__ == "__main__":
    main()

